<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Interactive PHP Date Formatter</title>
</head>
<body>

<div class="phpfr-content">
	<h1>
		Interactive PHP Date Formatter
	</h1>

	<p>
		Unrecognized characters in the format string will render as-is.
	</p>
	
	<div id="date-display">Enter a format or select a date constant (PHP 5.1+).</div>
	
	<form id="date-input" onsubmit="PHPFR.dates.get($F('date-string'));return false;">
		<input type="text" id="date-string" value="" oninput="PHPFR.dates.get(this.value);"/>
		<input type="button" value="Copy to Pasteboard" onclick="PHPFR.util($F('date_string'));"/><br/>
		<strong>Date Constants (PHP 5.1 and above):</strong>
		<select id="constants" onchange="PHPFR.dates.put(this.value);">
			<option value="">--Select One--</option>
			<option value="DATE_ATOM">DATE_ATOM</option>
			<option value="DATE_COOKIE">DATE_COOKIE</option>
			<option value="DATE_ISO8601">DATE_ISO8601</option>
			<option value="DATE_RFC822">DATE_RFC822</option>
			<option value="DATE_RFC850">DATE_RFC850</option>
			<option value="DATE_RFC1036">DATE_RFC1036</option>
			<option value="DATE_RFC1123">DATE_RFC1123</option>
			<option value="DATE_RFC2822">DATE_RFC2822</option>
			<option value="DATE_RSS">DATE_RSS</option>
			<option value="DATE_W3C">DATE_W3C</option>
		</select>
	</form>
	<script type="text/javascript">PHPFR.dates.init();</script>
	
	<p>
		<span class="link" id="link-day"      onclick="PHPFR.ui.showTab('day');$('date-string').focus();">Day</span> | 
		<span class="link" id="link-week"     onclick="PHPFR.ui.showTab('week');$('date-string').focus();">Week</span> | 
		<span class="link" id="link-month"    onclick="PHPFR.ui.showTab('month');$('date-string').focus();">Month</span> | 
		<span class="link" id="link-year"     onclick="PHPFR.ui.showTab('year');$('date-string').focus();">Year</span> | 
		<span class="link" id="link-time"     onclick="PHPFR.ui.showTab('time');$('date-string').focus();">Time</span> | 
		<span class="link" id="link-timezone" onclick="PHPFR.ui.showTab('timezone');$('date-string').focus();">Time Zone</span> | 
		<span class="link" id="link-fulldate" onclick="PHPFR.ui.showTab('fulldate');$('date-string').focus();">Full Date</span> | 
		<span class="link" id="link-examples" onclick="PHPFR.ui.showTab('examples');$('date-string').focus();">Examples</span>
	</p>
	
	<hr>
	
	<!-- BEGIN: DAY -->
	<div class="phpfr-section" id="day">
		<table>
			<caption>Day</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>d</td>
					<td>Day of the month, 2 digits with leading zeros</td>
					<td>01 to 31</td>
				</tr>
				<tr>
					<td>D</td>
					<td>A textual representation of a day, three letters</td>
					<td>Mon through Sun</td>
				</tr>
				<tr>
					<td>j</td>
					<td>Day of the month without leading zeros</td>
					<td>1 to 31</td>
				</tr>
				<tr>
					<td>l (lowercase 'L')</td>
					<td>A full textual representation of the day of the week</td>
					<td>Sunday through Saturday</td>
				</tr>
				<tr>
					<td>N</td>
					<td>ISO-8601 numeric representation of the day of the week (added in PHP 5.1.0)</td>
					<td>1 (for Monday) through 7 (for Sunday)</td>
				</tr>
				<tr>
					<td>S</td>
					<td>English ordinal suffix for the day of the month, 2 characters</td>
					<td>&#13; st, nd, rd or th. Works well with j</td>
				</tr>
				<tr>
					<td>w</td>
					<td>Numeric representation of the day of the week</td>
					<td>0 (for Sunday) through 6 (for Saturday)</td>
				</tr>
				<tr>
					<td>z</td>
					<td>The day of the year (starting from 0)</td>
					<td>0 through 365</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: DAY -->
	
	<!-- BEGIN: WEEK -->
	<div class="phpfr-section" id="week">
		<table>
			<caption>Week</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>W</td>
					<td>ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)</td>
					<td>Example: 42 (the 42nd week in the year)</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: WEEK -->
	
	<!-- BEGIN: MONTH -->
	<div class="phpfr-section" id="month">
		<table>
			<caption>Month</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>F</td>
					<td>A full textual representation of a month, such as January or March</td>
					<td>January through December</td>
				</tr>
				<tr>
					<td>m</td>
					<td>Numeric representation of a month, with leading zeros</td>
					<td>01 through 12</td>
				</tr>
				<tr>
					<td>M</td>
					<td>A short textual representation of a month, three letters</td>
					<td>Jan through Dec</td>
				</tr>
				<tr>
					<td>n</td>
					<td>Numeric representation of a month, without leading zeros</td>
					<td>1 through 12</td>
				</tr>
				<tr>
					<td>t</td>
					<td>Number of days in the given month</td>
					<td>28 through 31</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: MONTH -->
	
	<!-- BEGIN: YEAR -->
	<div class="phpfr-section" id="year">
		<table>
			<caption>Year</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>L</td>
					<td>Whether it's a leap year</td>
					<td>1 if it is a leap year, 0 otherwise.</td>
				</tr>
				<tr>
					<td>o</td>
					<td>ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)</td>
					<td>Examples: 1999 or 2003</td>
				</tr>
				<tr>
					<td>Y</td>
					<td>A full numeric representation of a year, 4 digits</td>
					<td>Examples: 1999 or 2003</td>
				</tr>
				<tr>
					<td>y</td>
					<td>A two digit representation of a year</td>
					<td>Examples: 99 or 03</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: YEAR -->
	
	<!-- BEGIN: TIME -->
	<div class="phpfr-section" id="time">
		<table>
			<caption>Time</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>a</td>
					<td>Lowercase Ante meridiem and Post meridiem</td>
					<td>am or pm</td>
				</tr>
				<tr>
					<td>A</td>
					<td>Uppercase Ante meridiem and Post meridiem</td>
					<td>AM or PM</td>
				</tr>
				<tr>
					<td>B</td>
					<td>Swatch Internet time</td>
					<td>000 through 999</td>
				</tr>
				<tr>
					<td>g</td>
					<td>12-hour format of an hour without leading zeros</td>
					<td>1 through 12</td>
				</tr>
				<tr>
					<td>G</td>
					<td>24-hour format of an hour without leading zeros</td>
					<td>0 through 23</td>
				</tr>
				<tr>
					<td>h</td>
					<td>12-hour format of an hour with leading zeros</td>
					<td>01 through 12</td>
				</tr>
				<tr>
					<td>H</td>
					<td>24-hour format of an hour with leading zeros</td>
					<td>00 through 23</td>
				</tr>
				<tr>
					<td>i</td>
					<td>Minutes with leading zeros</td>
					<td>00 to 59</td>
				</tr>
				<tr>
					<td>s</td>
					<td>Seconds, with leading zeros</td>
					<td>00 through 59</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: TIME -->
	
	<!-- BEGIN: TIME ZONE -->
	<div class="phpfr-section" id="timezone">
		<table>
			<caption>Time Zone</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>e</td>
					<td>Timezone identifier (added in PHP 5.1.0)</td>
					<td>Examples: UTC, GMT, Atlantic/Azores</td>
				</tr>
				<tr>
					<td>I (capital i)</td>
					<td>Whether or not the date is in daylights savings time</td>
					<td>1 if Daylight Savings Time, 0 otherwise.</td>
				</tr>
				<tr>
					<td>O</td>
					<td>Difference to Greenwich time (GMT) in hours</td>
					<td>Example: +0200</td>
				</tr>
				<tr>
					<td>T</td>
					<td>Timezone setting of this machine</td>
					<td>Examples: EST, MDT ...</td>
				</tr>
				<tr>
					<td>Z</td>
					<td>Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.</td>
					<td>-43200 through 43200</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: TIME ZONE -->
	
	<!-- BEGIN: FULL DATE -->
	<div class="phpfr-section" id="fulldate">
		<table>
			<caption>Full Date</caption>
			<thead>
				<tr>
					<th>Format Character</th>
					<th>Description</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>c</td>
					<td>ISO 8601 date (added in PHP 5)</td>
					<td>2004-02-12T15:19:21+00:00</td>
				</tr>
				<tr>
					<td>r</td>
					<td><span class="link" onclick="PHPFR.ui.followLink('http://www.faqs.org/rfcs/rfc2822');">RFC 2822</span> formatted date</td>
					<td>Example: Thu, 21 Dec 2000 16:01:07 +0200</td>
				</tr>
				<tr>
					<td>U</td>
					<td>Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)</td>
					<td>See also <span class="link" onclick="PHPFR.functions.show('time');">time()</span></td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: FULL DATE -->
	
	<!-- BEGIN: EXAMPLES -->
	<div class="phpfr-section" id="examples">
		<table>
			<caption>Examples</caption>
			<thead>
				<tr>
					<th>Format String</th>
					<th>Example Returned Value</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">F j, Y, g:i a</span></td>
					<td>March 10, 2001, 5:16 pm</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">m.d.y</span></td>
					<td>03.10.01</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">j, n, Y</span></td>
					<td>10, 3, 2001</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">Ymd</span></td>
					<td>20010310</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">h-i-s, j-m-y, it is w Day z</span></td>
					<td>05-16-17, 10-03-01, 1631 1618 6 Fripm01</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">\I\t \i\s \t\h\e jS \d\a\y.</span></td>
					<td>It is the 10th day.</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">D M j G:i:s T Y</span></td>
					<td>Sat Mar 10 15:16:08 MST 2001</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">H:m:s \m \i\s\ \m\o\n\t\h</span></td>
					<td>17:03:17 m is month</td>
				</tr>
				<tr>
					<td><span class="link" onclick="PHPFR.dates.put(this.innerHTML);">H:i:s</span></td>
					<td>17:16:17</td>
				</tr>
			</tbody>
		</table>
	</div>
	<!-- END: EXAMPLES -->
</div>

</body>
</html>